$(function(){
    var name = $("#name");
    var user = localStorage.getItem("user");
    var admin = "，<a href='Login.html' style='color: red' id='loginout'>注销</a>&nbsp;<a href='Member.html' style='color: red'>后台管理</a>";
    var generaluser = "，<a href='Login.html' style='color: red' id='loginout'>注销</a>&nbsp;<a href='Member_Order2.html' style='color: red'>后台管理</a>";
    if(localStorage.length == 0){
        name.html("请<a href=\"Login.html\">登录</a>&nbsp;<a href=\"Regist.html\" style=\"color:#ff4e00;\">免费注册</a>");
    }else if(user =='系统管理员'){
        name.css('color','red');
        name.html(user+admin);
    }else {
        name.css('color','red');
        name.html(user+generaluser);
    }

    var afterlogout = $("#loginout");
    afterlogout.bind('click',function () {
        localStorage.clear();
    });

});